package be.gnx.log4jeclipse.log4j;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.spi.LoggingEvent;

public class Log4JServer implements Log4JListenerEvents, Log4JListenerCallbacks {

  public static void main(String[] args) {
    Log4JServer log4JServer = new Log4JServer();
    Log4JListener log4JListener = Log4JListener.getInstance();
    log4JListener.addLog4JListenerCallBacks(log4JServer);
    log4JListener.addLog4JListenerEvents(log4JServer);
    log4JListener.start(false);
  }

  public void receivedLoggingEvent(LoggingEvent loggingEvent, String client) {
    System.err.println(loggingEvent);
  }

  public List<PortBacklogInetaddress> getPortBacklogInetaddressList() {
    List<PortBacklogInetaddress> portBacklogInetaddresList = new ArrayList<PortBacklogInetaddress>();
    portBacklogInetaddresList.add(new PortBacklogInetaddress(4445));
    return portBacklogInetaddresList;
  }

}
